status: failed duration: 1.403s Captured stdout call zpk(z=2π·[], p=2π·[-0.1591549430918953], k=0.1) captured errors: args = (array([0.19921354, 0.19920518, 0.19919674, 0.19918821, 0.19917959, 0.19917088, 0.19916207, 0.19915318, 0.19914...8, 0.00273848, 0.00270978, 0.00268139, 0.00265328, 0.00262547, 0.00259795, 0.00257071, 0.00254376, 0.00251709])) kwds = {'decimal': 7} @wraps(func) def inner(*args, **kwds): with self._recreate_cm(): > return func(*args, **kwds) /opt/conda/lib/python3.12/contextlib.py:81: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /opt/conda/lib/python3.12/contextlib.py:81: in inner return func(*args, **kwds) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (.compare at 0x7f6870947d80>, array([0.19921354, 0.19920518, 0.19919674, 0...8, 0.00273848, 0.00270978, 0.00268139, 0.00265328, 0.00262547, 0.00259795, 0.00257071, 0.00254376, 0.00251709])) kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True} @wraps(func) def inner(*args, **kwds): with self._recreate_cm(): > return func(*args, **kwds) E AssertionError: E Arrays are not almost equal to 7 decimals E E Mismatched elements: 1000 / 1000 (100%) E Max absolute difference: 0.19921354 E Max relative difference: 0.5 E x: array([0.1992135, 0.1992052, 0.1991967, 0.1991882, 0.1991796, 0.1991709, E 0.1991621, 0.1991532, 0.1991442, 0.1991351, 0.1991259, 0.1991166, E 0.1991073, 0.1990978, 0.1990882, 0.1990785, 0.1990687, 0.1990589,... E y: array([0.3984271, 0.3984104, 0.3983935, 0.3983764, 0.3983592, 0.3983418, E 0.3983241, 0.3983064, 0.3982884, 0.3982702, 0.3982518, 0.3982333, E 0.3982145, 0.3981956, 0.3981764, 0.398157 , 0.3981375, 0.3981177,... /opt/conda/lib/python3.12/contextlib.py:81: AssertionError During handling of the above exception, another exception occurred: zpk = ((), (-1,), 0.1) @pytest.mark.parametrize('zpk', [ ((0,), (), 0.1), ((), (0,), 0.1), ((-1,), (), 0.1), ((), (-1,), 0.1), ((0, 0,), (10, 10), 0.1), ((10, 10), (0, 0), 0.1), ((-1, -1,), (10, 10), 0.1), ((10, 10), (-1, -1), 0.1), ((0, ), (10, 10), 0.1), ((10, 10), (0,), 0.1), ((-1, ), (10, 10), 0.1), ((10, 10), (-1, ), 0.1), ]) def test_ZPK_various(zpk): """ Test the conversions to and from ZPK representation and statespace representation using a delay filter """ delta_t = 1 axB = mplfigB(Nrows=2) F_Hz = logspaced(0.01 / delta_t, 2 / delta_t, 1000) filt = SISO.zpk(zpk, fiducial_rtol=1e-7) print(filt) xfer1 = filt.fresponse(f=F_Hz).tf axB.ax0.semilogx(F_Hz, abs(xfer1), label="Direct ZPK") axB.ax1.plot(F_Hz, np.angle(xfer1, deg=True)) xfer2 = (filt * filt).fresponse(f=F_Hz).tf axB.ax0.semilogx(F_Hz, abs(xfer2), label="ZPK self product") axB.ax1.plot(F_Hz, np.angle(xfer2, deg=True)) filt_ss = filt.asSS * 4 filt_ssi = 1/filt_ss xfer3 = filt_ss.fresponse(f=F_Hz).tf xfer3b = filt_ssi.fresponse(f=F_Hz).tf axB.ax0.semilogx(F_Hz, abs(xfer3) / 4, label="ZPK2SS") axB.ax1.plot(F_Hz, np.angle(xfer3, deg=True)) axB.ax0.semilogx(F_Hz, abs(1/xfer3b) / 4, label="ZPK2SS inv") axB.ax1.plot(F_Hz, np.angle(1/xfer3b, deg=True)) filt_zpk = filt_ss.asZPK filt_zpki = filt_ssi.asZPK xfer4 = filt_zpk.fresponse(f=F_Hz).tf xfer4b = (1/filt_zpk).fresponse(f=F_Hz).tf xfer4c = (filt_zpki).fresponse(f=F_Hz).tf axB.ax0.semilogx(F_Hz, abs(xfer4) / 4, label="SS2ZPK") axB.ax1.plot(F_Hz, np.angle(xfer3, deg=True)) axB.ax0.semilogx(F_Hz, abs(1/xfer4b) / 4, label="SS2ZPK inv") axB.ax1.plot(F_Hz, np.angle(1/xfer4b, deg=True)) axB.ax0.semilogx(F_Hz, abs(1/xfer4c) / 4, label="SS2ZPK ss inv") axB.ax1.plot(F_Hz, np.angle(1/xfer4c, deg=True)) axB.ax0.legend() axB.save(tjoin("test_ZPK")) np.testing.assert_almost_equal(xfer2, xfer1**2) > np.testing.assert_almost_equal(xfer3, 4 * xfer1) ../../src/wield/control/SISO/test/test_SISO_delay.py:219: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (array([0.19921354-0.01251696j, 0.19920518-0.01258299j, 0.19919674-0.01264937j, 0.19918821-0.01271609j, ...30007j, 0.00259795-0.03213144j, 0.00257071-0.03196367j, 0.00254376-0.03179675j, 0.00251709-0.03163068j])) kwds = {} @wraps(func) def inner(*args, **kwds): with self._recreate_cm(): > return func(*args, **kwds) E AssertionError: E Arrays are not almost equal to 7 decimals E ACTUAL: array([0.19921354-0.01251696j, 0.19920518-0.01258299j, E 0.19919674-0.01264937j, 0.19918821-0.01271609j, E 0.19917959-0.01278315j, 0.19917088-0.01285057j,... E DESIRED: array([0.39842707-0.02503391j, 0.39841037-0.02516598j, E 0.39839348-0.02529873j, 0.39837642-0.02543217j, E 0.39835918-0.02556631j, 0.39834175-0.02570114j,... /opt/conda/lib/python3.12/contextlib.py:81: AssertionError